UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '++KIofCUXHqfU2g9vwIfwtVUGCojTRVTA1ZepWEQzeI='
WHERE
key_id = '43c5b75fd0572d9916fdf45c9e6cbf155249879e95e9e2c32129ab00fb5855bc'
AND (
token = '++KIofCUXHqfU2g9vwIfwtVUGCojTRVTA1ZepWEQzeI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)