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