UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5EdaSOK545Xb8KXXIRQj7oFCMnqDb/SUgceGKBCVct0='
WHERE
key_id = 'a2378744a04742c0ad0408d5d9e6c4c4e4b1ed6caf5ccbf959a536e33b784e42'
AND (
token = '5EdaSOK545Xb8KXXIRQj7oFCMnqDb/SUgceGKBCVct0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)