UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uI4Nb/4GOXyMEos6rCbz4rStR5EzDJaE9GAniJS1n0w='
WHERE
key_id = '4c2a209649328f84387b625a3cdff1c9fa40a44a348bb0e75c860d2075a9be1f'
AND (
token = 'uI4Nb/4GOXyMEos6rCbz4rStR5EzDJaE9GAniJS1n0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)