UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1xJfrqDV6vFXTk4WAgzNki7igEYSyqQHX5ArgWRa3nY=' 
WHERE 
  key_id = 'f3776a61b4a4c9da4269c780cac6b22a34a37f47b78a5ec9a0875898e727c646' 
  AND (
    token = '1xJfrqDV6vFXTk4WAgzNki7igEYSyqQHX5ArgWRa3nY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019