UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3IYlMfQL+2MezxvgEuwX+B6R601cJTV3gWUsyeqN7as=' 
WHERE 
  key_id = 'c691c0a7db738ce8b5e4ddbcb53528a6da8acf86678558b1e68cf7aaa091efc1' 
  AND (
    token = '3IYlMfQL+2MezxvgEuwX+B6R601cJTV3gWUsyeqN7as=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032