UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UbVKXa7QLAdyJGvKOCCLY/+utVSPX7fNQ/Fw291IyfM=' 
WHERE 
  key_id = 'a265179f887c84da3a78186941d525fb8c78c6e9e362fe319e51fadaabb698c9' 
  AND (
    token = 'UbVKXa7QLAdyJGvKOCCLY/+utVSPX7fNQ/Fw291IyfM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025