UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CITc+S0DpWdYT5W+wM+2bkUBDuHwMVmmrPgK9cgJGfo=' 
WHERE 
  key_id = '52685fe47a73277190213b16e474feddf23f2707ae14cfc7aee4932aec1953d5' 
  AND (
    token = 'CITc+S0DpWdYT5W+wM+2bkUBDuHwMVmmrPgK9cgJGfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022