UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xUnFVWCNEhgobDDQzq9LBAIynvGmCGHltMGZRItT7NY='
WHERE
key_id = 'e4f4c1e890f03c0ce83704e5531a5b0423ef4c53ab9d1ca4d7d310759456f428'
AND (
token = 'xUnFVWCNEhgobDDQzq9LBAIynvGmCGHltMGZRItT7NY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)