UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TKAbr0weE5wVMVXcNsR23ZRoBmqblV37/ZqG741Jk8g='
WHERE
key_id = 'd459d0a903a18c17f05a7223e01ec8d9897db18576ab4cb5cc896dd416f4c95b'
AND (
token = 'TKAbr0weE5wVMVXcNsR23ZRoBmqblV37/ZqG741Jk8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)