UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5EDCH4+yF1qKjx6c0zWNYa47BRyClpIUtEzhWUOXDsQ=' 
WHERE 
  key_id = '598eb0bea156e392968814ac8e6037683a14e93c16b1c2d91e3190c7e4fdb427' 
  AND (
    token = '5EDCH4+yF1qKjx6c0zWNYa47BRyClpIUtEzhWUOXDsQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00138