UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Px5Ql26+T0B8R4qj1BV/QQfB9QNTLDuzezRwTJwTdaU=' 
WHERE 
  key_id = '035dce7d3681173b774dfd4b974ec300e96cead0a7ec1027c0c7c2513b4db51a' 
  AND (
    token = 'Px5Ql26+T0B8R4qj1BV/QQfB9QNTLDuzezRwTJwTdaU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017