UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/N/xdx7Er3aU2o60oIapCx7h20vw22CUT8FqP5gyAtI=' 
WHERE 
  key_id = '7ab964deb26603a78ac9989f4714c4ee4e899591521c12b0ee38848e5808529e' 
  AND (
    token = '/N/xdx7Er3aU2o60oIapCx7h20vw22CUT8FqP5gyAtI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044