UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Vu9bMdGLoViIYdV2nXlS9DmRmYUUEMpf7kMUI8QqyM=' 
WHERE 
  key_id = '9b02101101ff591c597ede929ab0c35c614d9aecfefef7212c79e75fbf43eec5' 
  AND (
    token = '9Vu9bMdGLoViIYdV2nXlS9DmRmYUUEMpf7kMUI8QqyM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018