UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jb+1bb4d29n+BrNn+2Ryw1c0krTgCyOzAtLbuRapc9A=' 
WHERE 
  key_id = '62e3e82c2bda278345729f91ee8c4768b8fdfb7654c56a80ffb0babab750d88c' 
  AND (
    token = 'jb+1bb4d29n+BrNn+2Ryw1c0krTgCyOzAtLbuRapc9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032