UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P2+DeJUz2BKOFwo3hoC4MItvUVTa3/qPGH3YNeDMUHQ=' 
WHERE 
  key_id = '66e3064cd7a9ef0c65ef2b23ebdac5d4d6abd5c84e1eef3f4c851e79719560b4' 
  AND (
    token = 'P2+DeJUz2BKOFwo3hoC4MItvUVTa3/qPGH3YNeDMUHQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038