UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PvmrU2umaQ6a9R+xrAiR6RNWQlTQvHO23M23V55ch0I='
WHERE
key_id = '354de3ae7e4b43788dd515725d8df3db32f6b72d74dd15d7793e5c714455e348'
AND (
token = 'PvmrU2umaQ6a9R+xrAiR6RNWQlTQvHO23M23V55ch0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)