UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q3cpgbzNKb09tpaDVKj8BJ/gWNi2umomx13HtxS/Piw=' 
WHERE 
  key_id = 'ca8d3ffeae66afe57cd6d0d2aa5a77e92cc8e3b232b1ba9e7b15b864643beb63' 
  AND (
    token = 'q3cpgbzNKb09tpaDVKj8BJ/gWNi2umomx13HtxS/Piw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043