UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3A6dHkYXD3ZJy5Ng2sQUan0GhyO87U+ZNpUcUI0PdJU=' 
WHERE 
  key_id = 'e144c06bc392de660f764df68db965d6499bcae73cff49950650314420c04c13' 
  AND (
    token = '3A6dHkYXD3ZJy5Ng2sQUan0GhyO87U+ZNpUcUI0PdJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028