UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v9Ujl2+8WMlanwrbbiZ7wSArg0UUra7qdRJWBIk57Js='
WHERE
key_id = '3c4f56a9c558c002631f58b393b4e7b4144fa4fc307bf9f45595d32f1b028833'
AND (
token = 'v9Ujl2+8WMlanwrbbiZ7wSArg0UUra7qdRJWBIk57Js='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)