UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+4bWpJqnhp/s00lC47xS+bOm83aA7U9mjP34HgVkIEI='
WHERE
key_id = '5113b9001b5c9e9e91f82a8de16a37f3e5bc1e96d04ef5eb154388e4e28f5538'
AND (
token = '+4bWpJqnhp/s00lC47xS+bOm83aA7U9mjP34HgVkIEI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)