UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lhg/eCGjJJ5/8oU4TB6hSNeYtjJqU5b0wlpNUCTeI+I='
WHERE
key_id = '14a51cc8737ec942fc2e8104ad4a3a7cda20ec114489a74749abdd41c16885f0'
AND (
token = 'Lhg/eCGjJJ5/8oU4TB6hSNeYtjJqU5b0wlpNUCTeI+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)