UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bts3SdcOPr9iexL9ocG5uIe7UFA1RLsjTyw6qmlBiJg=' 
WHERE 
  key_id = '6076ead6fd0e4dff3430dae85bebaae33b4c7d0636a9822edccf1a2d4e4fbd85' 
  AND (
    token = 'Bts3SdcOPr9iexL9ocG5uIe7UFA1RLsjTyw6qmlBiJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069