UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X/Hg08cSQ11+FhbK2AD4hwYjd8zfoYk5uTFHRK5Cyb0=' 
WHERE 
  key_id = '4edb44bcc6e68892f080c4bd220c891de07ae075ca51efb3ef64d07ff4dc9304' 
  AND (
    token = 'X/Hg08cSQ11+FhbK2AD4hwYjd8zfoYk5uTFHRK5Cyb0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029