UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z0yEkclah0pNPjiImZPv//MbHNb81xsB0B3Wd+I+M+U='
WHERE
key_id = '43ec68919368dee3aa1cdea3d0b19620dacfe4c61e9307cf3559e1c6b9d90d88'
AND (
token = 'Z0yEkclah0pNPjiImZPv//MbHNb81xsB0B3Wd+I+M+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)