UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4lRho/z/3SzNK1uMDIMU4F/OtmI6MO7/X17v5sRq8Ss=' 
WHERE 
  key_id = '328ccb3ea02d7c29a0f0a3b24c67ce453efe13126c878b556b0a2cd5b0f42cf6' 
  AND (
    token = '4lRho/z/3SzNK1uMDIMU4F/OtmI6MO7/X17v5sRq8Ss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045