UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wUWdWSTtRf9smL6THhwwMaGwOmcXWCKZTNN7QXZoxWU=' 
WHERE 
  key_id = '280463a0e28c33bbdaca35918d9120ddebbffec5eb985fa5ee220f24fcb8862f' 
  AND (
    token = 'wUWdWSTtRf9smL6THhwwMaGwOmcXWCKZTNN7QXZoxWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062