UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SuM3N2m1eGOXzuGE3fmP/uc8E7WMqrh0ea3zsJXJ4s8=' 
WHERE 
  key_id = 'f602f1a23991daf89055f26b1322a2e75b5fd115bb26416b0d03a33ddb65902a' 
  AND (
    token = 'SuM3N2m1eGOXzuGE3fmP/uc8E7WMqrh0ea3zsJXJ4s8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016