UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vLd//3g6HGAzHD5AnjKIaDg+Y53rLzE8zaQe3gAe3pc='
WHERE
key_id = '1c774a4eca765df43963b24bf773d7922ec9cb087dfe7d5090f7a68d5236d622'
AND (
token = 'vLd//3g6HGAzHD5AnjKIaDg+Y53rLzE8zaQe3gAe3pc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)