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