UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '24tpvmKPsmxpVQGyyJiXrjt0gjWLmq0sSPf5+CX4cBA='
WHERE
key_id = '6a8c7ddc81d8b51095d2ac746cd3eacbb9365b21fe7baa531d924a5d8efb7d25'
AND (
token = '24tpvmKPsmxpVQGyyJiXrjt0gjWLmq0sSPf5+CX4cBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)