UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pZHtMehnsfxNzRtys9M5DAypdeXTXTPKiqo0QbcSD5Q='
WHERE
key_id = '6b525ea5ab1d0df8a6078b1a8919f707437eb59e13853fc71703c223a50526a6'
AND (
token = 'pZHtMehnsfxNzRtys9M5DAypdeXTXTPKiqo0QbcSD5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)