UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W+qCEeQtrd+uzmXP2vQ9kbdAriBUS3XRtpFSj1u+J2E=' 
WHERE 
  key_id = 'dc6df186a2e3a6f6c3f409880b1c458435eefd93c6d044cc20f6e69dd5bec101' 
  AND (
    token = 'W+qCEeQtrd+uzmXP2vQ9kbdAriBUS3XRtpFSj1u+J2E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042