UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nEXIT+QfgrqgdDbzEaKqm9g+zbJdprE3RqoFT1qzxM4='
WHERE
key_id = '4ea4e0db0bde8e0741ad115a30cd6449e570546eafbc7fcf8942620d802c5db9'
AND (
token = 'nEXIT+QfgrqgdDbzEaKqm9g+zbJdprE3RqoFT1qzxM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)