UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DHOzUXyoRI2QwNJzkH0VZ0je7DNxCwzEzT/muO7LPSE='
WHERE
key_id = 'd92dbdfb0321f061b599024045e1be53b184b3778909b862d7ae0d1a2062a31c'
AND (
token = 'DHOzUXyoRI2QwNJzkH0VZ0je7DNxCwzEzT/muO7LPSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)