UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ItUjbbd7PnMrUQb/2gKT860o0rYftCQUTLRqlaQ6WSA='
WHERE
key_id = '583b65b89edbf2939756133c242af535d978bbd59fc5ec2ed31b17ff2328ec7f'
AND (
token = 'ItUjbbd7PnMrUQb/2gKT860o0rYftCQUTLRqlaQ6WSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)