UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oopMhan+Ye3JVyKKzMGRdNmfv2Lmfj4JkOcNUicuiTA=' 
WHERE 
  key_id = '3dd44688808eda09cf297af1006841895658020c88421fb697bfa41dfa47d6e0' 
  AND (
    token = 'oopMhan+Ye3JVyKKzMGRdNmfv2Lmfj4JkOcNUicuiTA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041