UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8MVaZqOwxSdHY6A35xDTjtR1z2nntgdJ7wyXcN2G+g4='
WHERE
key_id = '4890965fa1c535a25d851fc5891e4ae3c79760fae9f2a6999359e9432e4fb8c5'
AND (
token = '8MVaZqOwxSdHY6A35xDTjtR1z2nntgdJ7wyXcN2G+g4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)