UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tmrRikI3z85gbWBEroqRoh64xCH3amXFQib9LWFIFiQ=' 
WHERE 
  key_id = '3f8746ddecea1b0e5bd63f7c51a8fd373e32d2ab5f25e85ed1c74b3de3c2ab98' 
  AND (
    token = 'tmrRikI3z85gbWBEroqRoh64xCH3amXFQib9LWFIFiQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035