UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5TIfo0fULUwaB1M/2zbVg5/bZFkHX/yySzxRDpS6Mzo='
WHERE
key_id = '9810c70f6d22506e5986eaf880c9d0d50a5f8133376c848b9714169b7485efd1'
AND (
token = '5TIfo0fULUwaB1M/2zbVg5/bZFkHX/yySzxRDpS6Mzo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)