UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5vquT4rpMkB2PIwFxDMB2KE0mC0JkXeOtFp4tGT47V8=' 
WHERE 
  key_id = '634f75b84a710350e7d9b316d1093618de802c972644bccc1b60c56773162bcb' 
  AND (
    token = '5vquT4rpMkB2PIwFxDMB2KE0mC0JkXeOtFp4tGT47V8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035