UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xfqhCLPeIuSaUIfyuz/T9kTIo9Zoz+37Du8YSu3wZb4=' 
WHERE 
  key_id = '1a54107c7560b2098af79b4b0516318d6b4fd6f2ec8c6ae8fc643cccc94b9f4c' 
  AND (
    token = 'xfqhCLPeIuSaUIfyuz/T9kTIo9Zoz+37Du8YSu3wZb4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035