UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4j2Gxc3+i1GXbw2M+9Ahde2b43iXd5PyME4tM/xgXIo=' 
WHERE 
  key_id = 'a5c7f41fa7b9f3dc8c9fbfed21a942a26f9f315d96ca7d8a8abe2968c6340c85' 
  AND (
    token = '4j2Gxc3+i1GXbw2M+9Ahde2b43iXd5PyME4tM/xgXIo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028