UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6hi3sdUM1AD+axxVd76PWKLxcvq8tAG3Gp0jxOVfb4w=' 
WHERE 
  key_id = '5906985d752d311cc9b3179c9d864f88ae4380b824e64c2101a1903c7bb8c16e' 
  AND (
    token = '6hi3sdUM1AD+axxVd76PWKLxcvq8tAG3Gp0jxOVfb4w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055