UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QsC4R7Zs6hQ5AR1bv7oXWKSj7gG5FErDt7S9ZAY2TWY='
WHERE
key_id = '0eeada3e7911057c84f6a408c237d33f20a7800d374f44bdfb4332c9c6745602'
AND (
token = 'QsC4R7Zs6hQ5AR1bv7oXWKSj7gG5FErDt7S9ZAY2TWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)