UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eUWwJpyx9ostqKC3UoJwf9IeNmgoqZmvLjQVmjXJxes='
WHERE
key_id = '7d45329e430552e3d3bdb9b8c443d46ae0dad5464b4fb99eace520f4cc98d687'
AND (
token = 'eUWwJpyx9ostqKC3UoJwf9IeNmgoqZmvLjQVmjXJxes='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)