UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Swy3xu5gxNL3eYB20G2hwdrk/oI7F1kHW/eY3GRdI+o=' 
WHERE 
  key_id = 'bb23d1e6fc3879a0ba6b79ffd21ee02e68ad4c7099f78e44d547782cf15fdd47' 
  AND (
    token = 'Swy3xu5gxNL3eYB20G2hwdrk/oI7F1kHW/eY3GRdI+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029