UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3eQSOyMhR9Xj1OsqufLWP+qMnxYAZ6xue2p1IwMQeWM=' 
WHERE 
  key_id = '526fa3e3ef68fa8bd956fac86e06ae25e9a7ec08ffbc098085af5ada977faf8b' 
  AND (
    token = '3eQSOyMhR9Xj1OsqufLWP+qMnxYAZ6xue2p1IwMQeWM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033