UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+uBbWZuy6BReNbzHe5XkmK7dWlb7nqs7bdYY7bqX5Fc='
WHERE
key_id = '372d9f7fbbf4fd5e12293ee14b01075876c2842f89f0883a20d9dd5f845c8b60'
AND (
token = '+uBbWZuy6BReNbzHe5XkmK7dWlb7nqs7bdYY7bqX5Fc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)