UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'piExTroJPHk/g+cvpglu6x0LYcTf3gamyUybJtTKo6w='
WHERE
key_id = '59e44500cdeca4c2346659617163b5e8ca6620d54ad720baf216441c310e1e35'
AND (
token = 'piExTroJPHk/g+cvpglu6x0LYcTf3gamyUybJtTKo6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)