UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PA+EnU3ExMtdt7dZUM991DJDhp0ZcYWj3hG8LYoogaM='
WHERE
key_id = 'dadb19615c096e7e4424def22534c5d662ee33ea3c7c2af06f599c04890b1762'
AND (
token = 'PA+EnU3ExMtdt7dZUM991DJDhp0ZcYWj3hG8LYoogaM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)