UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9+rdG5CMWU1IhGd00t4+FPQMZWgsqhS3OsgLwKeK7OA='
WHERE
key_id = 'ab8b0abf92104d32e1b9dac767a958107108a1f9ef54ac9ad2630a5413cc1f75'
AND (
token = '9+rdG5CMWU1IhGd00t4+FPQMZWgsqhS3OsgLwKeK7OA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)