UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1U2q93xHwN6KDzysJebQXXDw+ZnVgS2qMcyhATPaTxA='
WHERE
key_id = '4537c24bdd923b3395ec4282737f58d0c156ed193b6e855c75389304fc1f30e3'
AND (
token = '1U2q93xHwN6KDzysJebQXXDw+ZnVgS2qMcyhATPaTxA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)