UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HXYV7CwE2Ks1G8owk3ZWkW+zitzDOPXBPTHFRZXDSpk='
WHERE
key_id = 'd4ec820adb8d5a2cdc36650329ecff97d55ee455669a7e99ddb914572eabafdd'
AND (
token = 'HXYV7CwE2Ks1G8owk3ZWkW+zitzDOPXBPTHFRZXDSpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)