UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kyrY6sGCLH3YDFoMM9TB+Z15Rdbqlm2u7IWPo9Ntgp4='
WHERE
key_id = '175a82b0528b4b1b3163d03912dd7adb6389ab40c9b690bf9f1e694fdfd320d6'
AND (
token = 'kyrY6sGCLH3YDFoMM9TB+Z15Rdbqlm2u7IWPo9Ntgp4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)