UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OzWeGZyweExoneTqI/lz1XxjMdvg84yMd4d9zi/ngP0='
WHERE
key_id = 'aaf6eb90410f1ca46714c9cdc89d9dd3a6b16e8e36c710a58380802e3b253fd5'
AND (
token = 'OzWeGZyweExoneTqI/lz1XxjMdvg84yMd4d9zi/ngP0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)