UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RQTn2ElMwdbiPKt2lAresDxG3mxnXo9aYK7VB/lhk7c='
WHERE
key_id = '89e48fc1447c5c79c51490cddd422cb7d17cf1b099341961ea2919b264461aee'
AND (
token = 'RQTn2ElMwdbiPKt2lAresDxG3mxnXo9aYK7VB/lhk7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)